package com.puzzlebazar.client.squaregrid.control;

import com.google.gwt.event.dom.client.MouseEvent;
import com.google.gwt.event.shared.EventHandler;
import com.puzzlebazar.client.util.Vec2i;

public interface RectangleCallback {

	/**
	 * Rectangle starts at a specific location
	 * 
	 * @param loc
	 * @param event The mouse event that generated this call
	 * @return True if the operation is permitted
	 */
	public boolean rectangleBegin( Vec2i loc, MouseEvent<? extends EventHandler> event  );
	
	/**
	 * Rectangle is being changed between the two passed locations
	 * 
	 * @param loc1 One corner of the rectangle
	 * @param loc2 Diagonally opposed corner of the rectangle
	 * @param event The mouse event that generated this call
	 * @return True if the change is permitted
	 */
	public boolean rectangleChange( Vec2i loc1, Vec2i loc2, MouseEvent<? extends EventHandler> event  );
	
	/**
	 * Rectangle is being completed between the two passed locations
	 * 
	 * @param loc1 One corner of the rectangle
	 * @param loc2 Diagonally opposed corner of the rectangle
	 * @param event The mouse event that generated this call
	 */
	public void rectangleEnd( Vec2i loc1, Vec2i loc2, MouseEvent<? extends EventHandler> event  );
	
}
